<?php 
header("Content-type: text/html; charset=utf-8");
define('UserPhotoPath','uploads/');
require_once('inc_jiaju.php');
connect();
if(!empty($_FILES["ctf_jiajulink"]["name"]))
{
    $ctf_jiajulink = uploadfile('ctf_jiajulink',UserPhotoPath,array('jpg','gif','png'));
}
else
{
    $ctf_jiajulink='';
}

$data = array(
    'ctf_name' => ($_POST['ctf_name']),
    'ctf_cid' => ($_POST['ctf_cid']),
    'ctf_brand' => ($_POST['ctf_brand']),
    'ctf_jiajulink' => $ctf_jiajulink,
    'ctf_intro' => ($_POST['ctf_intro']),
    'ctf_adddate' => ($_POST['ctf_adddate'])
    );
var_dump($data);
$result = add('jiaju',$data);

if($result)
{
    echo "插入成功";
  header('location:list.php');
}
else
{
  echo '插入失败';
  echo '<script>alert("插入失败！");location.href="'.$_SERVER['HTTP_REFERER'].'"</script>';
}
 ?>